from functools import reduce

DIGIT = {'0':0, '1':1, '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9}
def str2float(s):
     d = s.find('.')
     #print(d)
     a = s[:d]
     #print(a)
     b = s[-1:d:-1]
     #print(b)
     def char2num(c):
          return DIGIT[c]
     def strleft(a, b):
         return a*10+b
     def strright(a,b):
         return a*1.0/10+b
     return reduce(strleft, map(char2num, a))+reduce(strright, map(char2num,b))/10

print(str2float('1234.5678'))
